#pragma once
#include <map>
#include <string>
#include <vector>

#include "bondlib.h"
namespace qb {

class IPinyin {
 public:
  enum kFlag {
    kFlagBoth,
    kFlagJian,
    kFlagFull,
  };
  virtual ~IPinyin() {}
  virtual void GetPinyinBuffer(const char* buffer, wchar_t* jianbuf,
                               int& jianlen, wchar_t* quanbuf, int& quanlen) {}
  virtual void GetPinyin(const char* buffer, std::string& sJianpin,
                         std::string& sQuanpin, kFlag = kFlagBoth) = 0;
  virtual const std::string GetPinyin(const char* buffer) = 0;
  virtual void Dump(int select){};
};
class S_BONDLIB_EXPORT PinyinManager {
 public:
  static PinyinManager& instance();
  void GetPinyinBuffer(const char* buffer, wchar_t* jianbuf, int& jianlen,
                       wchar_t* quanbuf, int& quanlen);
  void GetPinyin(const char* buffer, std::string& sJianpin,
                 std::string& sQuanpin,
                 IPinyin::kFlag flag = IPinyin::kFlagBoth);
  const std::string GetPinyin(const char* buffer);
  void Dump(int select);

 protected:
  IPinyin* m_impl;

 private:
  PinyinManager();
  ~PinyinManager();
};
}  // namespace qb
